﻿using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

using AutoMapper;
using Kalman;
using Microsoft.AspNetCore.Authorization;
using Newtonsoft.Json.Linq;

namespace QuDao.Api.Controllers
{
    /// <summary>
    /// 基础数据API
    /// </summary>
    [AllowAnonymous]
    public class BaseDataController : ApiControllerBase
    {
        /// <summary>
        /// 获取租户商品类别列表
        /// </summary>
        [HttpGet] 
        public IEnumerable<CategoryDto> GetCategoryList([FromHeader] int tid)
        {
            var list = CategoryBO.Instance.GetList(tid);
            return list;
        }

        /// <summary>
        /// 获取租户银行账户列表
        /// </summary>
        [HttpGet]
        public IEnumerable<TenantAccountDto> GetTenantAccountList([FromHeader] int tid)
        {
            var list = TenantAccountBO.Instance.GetList(tid);
            return list;
        }

        /// <summary>
        /// 获取租户信息
        /// </summary>
        [HttpGet]
        public TenantDto GetTenantInfo([FromHeader] int tid)
        {
            return TenantBO.Instance.GetItem<TenantDto>(tid);
        }

        //[HttpGet]
        //public Dictionary<string, string> GetAppConfig()
        //{
        //    var dic = new Dictionary<string, string>();
        //    dic.Add("uc_image", "https://banan.oss-cn-hangzhou.aliyuncs.com/qudao/village/bg04.jpeg");  //个人中心（我的）页面背景图片
        //    dic.Add("", ""); //乡村头条频道页顶部图片
        //    dic.Add("", ""); //
        //    dic.Add("", ""); //
        //    dic.Add("", ""); //
        //    dic.Add("", ""); //
        //    dic.Add("", ""); //

        //    return dic;
        //}


    }
}
